<%@page import="helpers.StringHelper"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.Map"%>
<%@page import="entities.MetaSeo"%>
<%@page import="java.util.TreeMap"%>
<%
TreeMap check = (TreeMap) request.getAttribute("check");
TreeMap values = (TreeMap) request.getAttribute("values");
String success = (String) request.getAttribute("success");
MetaSeo metaseo = (MetaSeo) request.getAttribute("metaseo");

//Set content for Seo
Map<String, String> replates = new TreeMap<String, String>();
replates.put("__SERVER_NAME__", UrlHelper.getDomainServer(request));
replates.put("__SERVER_URL__", UrlHelper.getServerUrl(request));


String title = StringHelper.replateContent(metaseo.getTitle(), replates);
String description = StringHelper.replateContent(metaseo.getDescription(), replates);
String keywords = StringHelper.replateContent(metaseo.getKeywords(), replates);
String url = StringHelper.replateContent(metaseo.getOgurl(), replates);
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/templates/wpanswer/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="keywords" value="<%=keywords %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogurl" value="<%=url %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>

		<div class="row">
			<!-- Content BEGIN -->
			<div class="span8 main-content">
				<h1 class="title">Contact</h1>
				<div class="breadcrumbs">
					<p>
						<a href="/">Home</a> » Contact Us
					</p>
				</div>
				<hr />
				<div class="page_content">
					<p>If you have any questions, or comments and suggestions, please use the form below to contact us. Or you can mail to contact to us.</p>
					<div class="contact_form">
						<% if (success != null) { %>
						<p class="success_msg"><%=success %></p>
						<% } %>
						<form class="contact_form" method="post">
							<div class="form_row clearafter">
								<label>
									 Your Name
									<span class="indicates">*</span>
								</label>
								<input class="textfield span6" type="text" value="<%=values.get("name") != null ? values.get("name") : "" %>" name="name">
								<% if (check.get("name") != null ) { %>
								<span class="error_msg"><%=check.get("name") %></span>
								<% } %>
							</div>
							
							<div class="form_row clearafter">
								<label>
									 Email Address
									<span class="indicates">*</span>
								</label>
								<input class="textfield span6" type="text" value="<%=values.get("email") != null ? values.get("email") : "" %>" name="email">
								<% if (check.get("email") != null ) { %>
								<span class="error_msg"><%=check.get("email") %></span>
								<% } %>
							</div>
							
							<div class="form_row clearafter">
								<label>
									 Subject
									<span class="indicates">*</span>
								</label>
								<input class="textfield span6" type="text" value="<%=values.get("subject") != null ? values.get("subject") : "" %>" name="subject">
								<% if (check.get("subject") != null ) { %>
								<span class="error_msg"><%=check.get("subject") %></span>
								<% } %>
							</div>
							
							<div class="form_row clearafter">
								<label>
									 Message
									<span class="indicates">*</span>
								</label>
								<textarea class="textarea span8" rows="10" cols="40" name="content"><%=values.get("content") != null ? values.get("content") : "" %></textarea>
								<% if (check.get("content") != null ) { %>
								<span class="error_msg"><%=check.get("content") %></span>
								<% } %>
							</div>
							
							<div class="form_row clearafter">
								<label>
									 Captcha
									<span class="indicates">*</span>
								</label>
								<script>
						        	var RecaptchaOptions = { theme : 'clean' };
						  		</script>
								<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LeA0c4SAAAAAMsdjrB49GPol6XImTdJM2U2AHrF"></script>
								<% if (check.get("captcha") != null) { %>
									<span class="error_msg"><%=check.get("captcha")%></span>
								<% } %>
							</div>
							<br />
							<input class="btn_green btn_spacer" type="submit" value="Send">
						</form>
					</div>
				</div>
			</div>
			<!-- Content END -->
			
			<!-- slidebar BEGIN -->
			<jsp:include page="/templates/wpanswer/elements/right.jsp" />
			<!-- slidebar END -->
		</div>
		
		
<jsp:include page="/templates/wpanswer/layouts/footer.jsp" />